<template>
 <div class="partner">
     <!-- <HeaderTop title="合伙人中心"></HeaderTop> -->
     <div class="container">
         <van-cell title="我的下级" is-link to="/lower"/>
         <van-cell title="上月分销额" :value="'￥'+ lastMonth" />
         <van-cell title="本月分销额" :value="'￥'+ thisMonth" />
         <van-cell title="本年分销额" :value="'￥' + thisYear" />
         <van-cell title="累计收益" :value="'￥'+ cumulativeIncome" />
         <van-cell title="分销订单" is-link to="/fxorder"/>
     </div>
 </div>
</template>

<script>
// import HeaderTop from '../HeaderTop/HeaderTop'
import {mapState} from 'vuex'
 export default {
     data(){
         return {
             thisYear:2500,
             lastMonth:1500,
             thisMonth:1500,
             cumulativeIncome:8000
         }
     },
    //  components:{
    //      HeaderTop
    //  },
     computed:{
         ...mapState(['userInfo'])
     },
     mounted(){
        this.getPartnerInfo()
     },
     methods:{
        async getPartnerInfo(){
            console.log('合伙人信息')
            const userId = this.userInfo.userInfo.id
            const token = this.userInfo.token
            const result = await this.API.reqPartner({userId,token})
            const partner = result.retData
            this.thisYear = partner.thisYear || 0
            this.lastMonth = partner.lastMonth || 0
            this.thisMonth = partner.thisMonth || 0
            this.cumulativeIncome = partner.cumulativeIncome || 0
        }
     }
 }
</script>

<style lang="stylus" rel="stylesheet/stylus">
//  @import "../../common/stylus/mixins.styl"
//  .container
//     top-border-1px(#e4e4e4)
// .partner
//     margin-top 45px
</style>
